package com.axxc.jpa.entity;

import javax.persistence.Entity;
import javax.persistence.Index;
import javax.persistence.Table;

import org.apache.commons.lang3.StringUtils;

import com.axxc.jpa.out.common.utils.PinYinUtils;

/**
 * @ClassName: EnglishWordNoteBookEntity
 * @Description: TODO(这里用一句话描述这个类的作用)
 * @author xxc
 * @date 2018年8月20日 下午12:02:36
 * @see {@link https://gitee.com/biuabiu}
 */
@Entity
@Table(name = "t_englishword_notebook", indexes = { @Index(name = "index_english_word", columnList = "englishWord"),
		@Index(name = "index_chinese_meaning", columnList = "chineseMeaning") })
public class EnglishWordNoteBookEntity extends BaseEntity {

	private static final long serialVersionUID = 1L;

	private String englishWord;// 英语单词
	private String chineseMeaning;// 中文含义
	private String chineseMeaningLongSpell;// 中文长拼
	private String chineseMeaningShortSpell;// 中文短拼

	public String getEnglishWord() {
		return englishWord;
	}

	public void setEnglishWord(String englishWord) {
		this.englishWord = englishWord;
	}

	public String getChineseMeaning() {
		return chineseMeaning;
	}

	public void setChineseMeaning(String chineseMeaning) {
		this.chineseMeaning = chineseMeaning;
		if (StringUtils.isNotBlank(chineseMeaning)) {
			this.chineseMeaningLongSpell = PinYinUtils.toLongSpellLowercase(chineseMeaning);
			this.chineseMeaningShortSpell = PinYinUtils.toShortSpellLowercase(chineseMeaning);
		}
	}

	public String getChineseMeaningLongSpell() {
		return chineseMeaningLongSpell;
	}

	public String getChineseMeaningShortSpell() {
		return chineseMeaningShortSpell;
	}

}
